package edu.sctu.practice.class01.wulixia.month09_wlx.assign03.three;

/**
 * Created by wulixia on 2015/11/5.
 * （1）	创建Circle类，表示圆
 */
public class Circle {

    protected double radius;

    public Circle() {
        this(1.0);
    }

    public Circle(double radius) {
        this.radius = radius;
    }

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }

    public double findArea() {
        return radius * radius * Math.PI;
    }

    public double findPerimeter() {
        return 2 * radius * Math.PI;
    }

    public boolean equals(Circle circle) {
        return this.radius == circle.getRadius();
    }

    public String toString() {
        return "[Circle] radius = " + radius;
    }
}
